//
//  TuiJanCell.m
//  MyTest
//
//  Created by zhiyou on 16-4-13.
//  Copyright (c) 2016年 wangyang. All rights reserved.
//

#import "TuiJanCell.h"

@implementation TuiJanCell

- (void)awakeFromNib {
    // Initialization code
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _imgView = [[UIImageView alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:_imgView];
        
        [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(10);
            make.centerY.equalTo(self.mas_centerY);
            make.width.height.equalTo(self.mas_height).multipliedBy(.8);
        }];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _titleLabel.numberOfLines = 0;
        _titleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_titleLabel];
        
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_imgView.mas_right).offset(5);
            make.right.offset(-10);
            make.top.offset(5);
            make.height.equalTo(self.mas_height).multipliedBy(.4);
        }];
        
        _priceLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _priceLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_priceLabel];
        
        [_priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_imgView.mas_right).offset(5);
            make.top.equalTo(_titleLabel.mas_bottom).offset(0);
            make.height.equalTo(self.mas_height).multipliedBy(.25);
            make.right.offset(0);
        }];
        
        _sourceLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _sourceLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_sourceLabel];
        
        [_sourceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_imgView.mas_right).offset(5);
            make.top.equalTo(_priceLabel.mas_bottom).offset(0);
            make.height.equalTo(self.mas_height).multipliedBy(.25);
            make.right.offset(0);
        }];
        
        
    }
    return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
